import com.bit.demo.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //1.先得到spring上下文对象
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        //2.获取bean对象（依赖查找）
        UserService userService = (UserService) context.getBean("user");
        //3.使用bean对象（非必须）
        userService.sayHi();
    }
}
